#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
string lowwers(string str)
{ //手写字符串该小写，死记！
    int len = str.size();
    for (int i = 0; i < len; i++)
    {
        str[i] = (str[i] >= 65 && str[i] <= 90) ? str[i] + 32 : str[i];
    }
    return str;
}
string inputs()
{ //输入，小写化，并且开头结尾加上' '
    string temp;
    getline(cin, temp);
    return ' ' + lowwers(temp) + ' ';
}
int main()
{
    string pas, goal;
    int pos = 0, count = 0, memory; //定位器
    goal = inputs();
    pas = inputs();
    pos = pas.find(goal, pos);
    if (pos == -1)
    {
        cout << pos;
        return 0;
    }
    else
    {
        memory = pos;
        count++;
        pos += goal.size() - 1;
    }
    while (pos < pas.size())
    {
        pos = pas.find(goal, pos);
        if (pos == -1)
        {
            break;
        }
        else
        {
            count++;
            pos = pos + goal.size() - 1;
        }
    }
    cout << count << ' ' << memory;
    return 0;
}